<template>
  <button
    class="v-btn"
    :class="[size?'v-button-'+size:'',btnStyle?btnStyle:'']"
    :disabled='disabled'
    @click="handleClick"
  >
    <span>
      <slot></slot>
    </span>
  </button>
</template>

<script>
export default {
  name: 'VButton',
  data () {
    return {
      value: 'nihao'
    }
  },
  props: {
    size: {
      type: String,
      default: 'default'
    },
    disabled: {
      type: Boolean,
      default: false
    },
    btnStyle: {
      type: String,
      default: 'java'
    }
  },
  methods: {
    handleClick (e) {
      this.$emit('on-click', this.value)
    }
  },
  mounted () {

  }
}
</script>

<style lang='scss'>
.v-btn {
  vertical-align: top;
  display: inline-block;
  text-align: center;
  line-height: 44px;
  border-radius: 4px;
  background: #fff;
  color: #fff;
  cursor: pointer;
}
.v-button-default {
  width: 160px;
  height: 44px;
}
.java {
  color: #eb9e05;
  height: 42px;
  line-height: 42px;
  width: 158px;
  border: 1px solid #eb9e05;
  opacity: 1;
  transition: all 0.6s;
  &:hover {
    background: #eb9e05;
    color: #fff;
  }
  &:active {
    opacity: 0.7;
  }
}
.c {
  height: 44px;
  line-height: 44px;
  background: #55acee;
  transition: all 0.5s;
  box-shadow: 0px 5px 0px 0px #3486d5;
  &:hover {
    background-color: #6fc6ff;
  }
  &:active {
    transform: translate(0px, 4px);
    -webkit-transform: translate(0px, 4px);
    box-shadow: 0px 1px 0px 0px #3486d5;
  }
}
@keyframes sheen {
  0% {
    transform: skewY(-45deg) translateX(0);
  }
  100% {
    transform: skewY(-45deg) translateX(12.5em);
  }
}
.js {
  width: 160px;
  height: 42px;
  line-height: 42px;
  background: #0d6;
  width: 158px;
  border: 1px solid #0d6;
  overflow: hidden;
  transition: all 0.5s;
  opacity: 1;
  &:hover,
  &:active {
    text-decoration: none;
    color: #0c5;
    border-color: #0c5;
    background: #fff;
  }
  &:active {
    opacity: 0.8;
  }
  & span {
    display: inline-block;
    position: relative;
    padding-right: 0;
    transition: padding-right 0.5s;
  }
  & span::after {
    content: "";
    position: absolute;
    top: 0;
    right: -18px;
    opacity: 0;
    width: 10px;
    height: 10px;
    margin-top: -10px;
    background: rgba(0, 0, 0, 0);
    border: 1px solid #fff;
    border-top: none;
    border-right: none;
    transition: opacity 0.5s, top 0.5s, right 0.5s;
    transform: rotate(-140deg);
  }
  &:hover span,
  &:active span {
    padding-right: 30px;
  }
  &:hover span:after,
  &:active span:after {
    transition: opacity 0.5s, top 0.5s, right 0.5s;
    opacity: 1;
    border-color: #0c5;
    right: 0;
    top: calc(50% + 2.5px);
    transform: rotate(-140deg);
  }
}
</style>
